<template>
    <div>
        <table class="table">
            <thead>
                <tr>
                    <th>制造商</th>
                    <th></th>
                    <th></th>
                </tr>
                <tbody>
                    <tr v-for="manufacturer in manufacturers" :key="manufacturer._id">
                        <td>{{manufacturer.name}}</td>
                        <td class="modify">
                            <router-link :to="'/admin/manufacturer/edit'+manufacturer._id">修改</router-link>
                        </td>
                        <td>
                            <a @click="removeManufacturer(manufacturer._id)" href="#">删除</a>
                        </td>
                    </tr>
                </tbody>
            </thead>
        </table>
    </div>
</template>

<script>
export default {
    created() {
    },
    computed: {
        manufacturers() {
            return this.$store.getters.allManufacturers
        }
    },
    methods: {
        removeManufacturer(manufacturerId) {
            const res = confirm("是否删除此制造商?")

            if (res) {

            }
        }
    }
}
</script>

<style>
table {
  margin: 0 auto;
}

.modify {
  color: blue;
}

.remove a {
  color: red;
}
</style>
